import {IMG_BASE_URL,IMG_BASE_URL_2} from './env.js' //引入接口共用地址
	/**
 * 图片路径转换
 * eparam {string} img_path 图片地址
 */

export const img = (img_path)=> {
	var path = "";
	if (img_path != undefined && img_path != "") {
		if (img_path.split('').length > 1) {
			img_path = img_path.split(',')[0];
		}
		if (img_path.indexOf("http://") == -1 && img_path.indexOf("https://") == -1) {
			path = IMG_BASE_URL + '/assets/mini' + (img_path[0]=='/' ? '' : "/") + img_path;
		} else {
			path = img_path;
			// path +="?t='+ parseInt(new Date().getTime()/ 1080);

		}
	}
	return path;
}


export const img_2 = (img_path)=> {
	var path = "";
	if (img_path != undefined && img_path != "") {
		if (img_path.split('').length > 1) {
			img_path = img_path.split(',')[0];
		}
		if (img_path.indexOf("http://") == -1 && img_path.indexOf("https://") == -1) {
			path = IMG_BASE_URL_2 + (img_path[0]=='/' ? '' : "/") + img_path;
		} else {
			path = img_path;
			// path +="?t='+ parseInt(new Date().getTime()/ 1080);

		}
	}
	return path;
}